<template>
  <div>
    <form @submit="addTodo">
      <el-input
        type="text"
        name="content"
        v-model="content"
        placeholder="Add Todo..."
      ></el-input>
      <el-button type="submit" @click="addTodo()">Submit</el-button>
    </form>
  </div>
</template>

<script>
  export default {
    name: "AddTodo",
    data() {
      return {
        content: "",
      }
    },
    methods: {
      addTodo() {
        // Send to parent
        this.$emit("add-todo", this.content)
        this.content = ""
      },
    },
  }
</script>

<style scoped>
  form {
    display: flex;
  }
</style>
